﻿using System.Web.Security;
using KLS.PPDS.Utility;

//Repository related activities will NOT be added hare.
namespace KLS.PPDS.Utilities.BaseModels
{
    public class ViewModelBase
    {
        public string Title { get; set; }

        public bool IsSuperAdmin { get { return CommonSession.IsUserSuperAdmin == true; } }
        

        public bool IsUserInRole(string role)
        {
            if (IsSuperAdmin)
            {
                return true;
            }
            else
            {
                return Roles.Provider.IsUserInRole(CommonSession.UserName, role);
            }
        }

       
    }
}
